package portal.mybatis.dao;

import java.util.Date;

import com.alibaba.fastjson.JSON;

import net.CommitJob;

public class HistoryJob{
    private Integer jobIndex;

    private String algorithmId;

    private Date commitTime;

    private Date startTime;

    private Date endTime;

    private String issuccess;

    private Integer isnew;

    private Integer resend;
    
    private String taskHash;

    private String algorithmHash;

    private String jobId;
    
    private String name;

    private String command;

    private String fullInfo;

    private String startInfo;

    public HistoryJob(){}
    public HistoryJob(CommitJob commitJob, String taskHash, String algorithmBlockId,
    		String jobId, String algorithmId, String index, String jobName,String fullInfo){
    	this.taskHash=taskHash;
    	this.algorithmHash=algorithmBlockId;
    	this.jobId=jobId;
    	this.algorithmId=algorithmId;
    	this.jobIndex=index==null?0:Integer.valueOf(index);
    	this.name=jobName;
    	this.fullInfo=fullInfo;
    	this.command=commitJob.getJhJobCommend();
    	this.startInfo=JSON.toJSONString(commitJob);
    }
    public HistoryJob(String status,String jobName,String fullInfo, String subTaskHash,String algorithmHash,String jobId,Date endTime){
    	this.endTime=endTime;
    	this.issuccess=status;
    	this.name=jobName;
    	this.taskHash=subTaskHash;
    	this.algorithmHash=algorithmHash;
    	this.jobId=jobId;
    	this.fullInfo=fullInfo;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        this.command = command == null ? null : command.trim();
    }

    public String getFullInfo() {
        return fullInfo;
    }

    public void setFullInfo(String fullInfo) {
        this.fullInfo = fullInfo == null ? null : fullInfo.trim();
    }

    public String getStartInfo() {
        return startInfo;
    }

    public void setStartInfo(String startInfo) {
        this.startInfo = startInfo == null ? null : startInfo.trim();
    }
    public String getTaskHash() {
        return taskHash;
    }

    public void setTaskHash(String taskHash) {
        this.taskHash = taskHash == null ? null : taskHash.trim();
    }

    public String getAlgorithmHash() {
        return algorithmHash;
    }

    public void setAlgorithmHash(String algorithmHash) {
        this.algorithmHash = algorithmHash == null ? null : algorithmHash.trim();
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId == null ? null : jobId.trim();
    }

    public Integer getJobIndex() {
        return jobIndex;
    }

    public void setJobIndex(Integer jobIndex) {
        this.jobIndex = jobIndex;
    }

    public String getAlgorithmId() {
        return algorithmId;
    }

    public void setAlgorithmId(String algorithmId) {
        this.algorithmId = algorithmId == null ? null : algorithmId.trim();
    }

    public Date getCommitTime() {
        return commitTime;
    }

    public void setCommitTime(Date commitTime) {
        this.commitTime = commitTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getIssuccess() {
        return issuccess;
    }

    public void setIssuccess(String issuccess) {
        this.issuccess = issuccess == null ? null : issuccess.trim();
    }

    public Integer getIsnew() {
        return isnew;
    }

    public void setIsnew(Integer isnew) {
        this.isnew = isnew;
    }

    public Integer getResend() {
        return resend;
    }

    public void setResend(Integer resend) {
        this.resend = resend;
    }
}